package cn.com.generaldata.os.dao.intf;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;

import org.hibernate.criterion.DetachedCriteria;

import cn.com.generaldata.os.paging.Filter;
import cn.com.generaldata.os.paging.Page;
import cn.com.generaldata.os.paging.Result;

public interface BaseDAOInterface<T> {

	void save(T t);
	
	void merge(T t);

	void update(T t);

	void delete(T t);

	void saveOrUpdate(T t);

	void delete(List<T> ts);

	T get(Class<?> clazz, Serializable id);

	List findByCriteria(DetachedCriteria dc);

	List findByCriteriaPage(DetachedCriteria dc, int firstResult, int maxResults);

	List<T> find(Class<?> clazz, Filter filter, Page page);

	int count(Class<?> clazz, Filter filter);

	List<T> findByHql(String hql, Object... params);

	List findEntitiesByHql(String hql, int first, int max, Object... params);

	Result hqlParam(String hql, HashMap map, Page page);

	List findByHqlReal(String hql, Object[] params);

	int countByHql(String hql, Object... params);

}
